//
//  IssueCell.m
//  Blank
//
//  Created by 马博 on 15/9/28.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "IssueCell.h"


#define windth [UIScreen mainScreen].bounds.size.width / 375
#define height ([UIScreen mainScreen].bounds.size.height > 568 ? [UIScreen mainScreen].bounds.size.height : 568) / 667

@implementation IssueCell

/* 重写初始化 */
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.ThemeLable = [[UILabel alloc] init];
        [self.contentView addSubview:self.ThemeLable];
        self.ThemeLable.numberOfLines = 0;
        
        
        self.TimeLable = [[UILabel alloc] init];
        [self.contentView addSubview:self.TimeLable];
        
        
        self.NameLable = [[UILabel alloc] init];
        [self.contentView addSubview:self.NameLable];
        
        
        self.image = [[UIImageView alloc] init];
        [self.contentView addSubview:self.image];

        
    }
    return self;
}


/* 布局子视图 */
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    
    
    self.ThemeLable.frame = CGRectMake(windth * 115, height * 10, windth * 250, height * 50);
    self.ThemeLable.font = [UIFont boldSystemFontOfSize:15];
    
    self.NameLable.frame = CGRectMake(windth * 260, height * 70, windth * 100, height * 30);
    self.NameLable.textColor = [UIColor grayColor];
    self.NameLable.font = [UIFont systemFontOfSize:16];
    
    self.TimeLable.frame = CGRectMake(windth * 115, height * 70, windth * 130, height * 30);
    self.TimeLable.font = [UIFont fontWithName:@"Marker Felt" size:15];
    self.image.frame = CGRectMake(windth * 10, height * 10, windth * 90, height * 80);
    
    //夜间
    if ([NightModel getColorModel]) {
        self.ThemeLable.backgroundColor = [UIColor grayColor];
        self.ThemeLable.textColor = [UIColor whiteColor];
        self.NameLable.backgroundColor = [UIColor grayColor];
        self.NameLable.textColor = [UIColor whiteColor];
        self.TimeLable.backgroundColor = [UIColor grayColor];
        self.TimeLable.textColor = [UIColor whiteColor];
        self.contentView.backgroundColor = [UIColor grayColor];
        
    }
    else{
        //白天
        self.ThemeLable.backgroundColor = [UIColor whiteColor];
        self.ThemeLable.textColor = [UIColor blackColor];
        self.NameLable.backgroundColor = [UIColor whiteColor];
        self.NameLable.textColor = [UIColor blackColor];
        self.TimeLable.backgroundColor = [UIColor whiteColor];
        self.TimeLable.textColor = [UIColor grayColor];
        self.contentView.backgroundColor = [UIColor whiteColor];
        
    }
    
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
